package com.geostar.constructionland.common.entity.statistics;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.Objects;

/**
 * @author yelll
 * @since 2020-7-14 9:45
 **/
@Data
@TableName(value = "statistics_profile")
@ApiModel("统计配置表")
public class StatisticsProfile {

    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    @ApiModelProperty("ID主键")
    private String id;

    @ApiModelProperty("统计名称")
    @TableField(value = "statistics_name")
    private String statisticsName;

    @ApiModelProperty("分析类型")
    @TableField(value = "fxlx")
    private String fxlx;

    @TableField(value = "ywid")
    @ApiModelProperty("业务ID")
    private String ywid;

    @ApiModelProperty("执行SQL")
    @TableField(value = "execute_sql")
    private String executeSql;

    @ApiModelProperty("执行顺序")
    @TableField(value = "execute_order")
    private int executeOrder;

    @ApiModelProperty("统计用途")
    @TableField(value = "statistics_detail")
    private String statisticsDetail;

    @ApiModelProperty("统计版本")
    @TableField(value = "statistics_version")
    private String statisticsVersion;

    @ApiModelProperty("修改时间")
    @TableField(value = "modified_time")
    private Date modifiedTime;

    @ApiModelProperty("唯一执行id")
    @TableField(value="UNIQUE_TASK_ID")
    private String uniqueTaskId;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        StatisticsProfile that = (StatisticsProfile) o;
        return Objects.equals(id, that.id) && Objects.equals(fxlx, that.fxlx) && Objects.equals(ywid, that.ywid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, fxlx, ywid);
    }
}
